﻿/****************************** Module Header ******************************\
 * Module Name:  WindowOpener.cs
 * Module Version:  1.0.0 (2012-8-10)
 * Copyright (c) AnyEB.Com (14507247@qq.com)
 * 
 * This class is used for WindowOpener.
 * 
 * This source is subject to the GPL License.
 * See http://www.gnu.org/licenses/gpl.html.
 * All other rights reserved.
 * 
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/
using System;

namespace UCL.Web
{
    /// <summary>
    /// Window窗体的Opener对象操作类
    /// </summary>
    public class WindowOpener
    {
        /// <summary>
        /// 设置父窗口控件的值
        /// </summary>
        /// <param name="inputId"></param>
        /// <param name="value"></param>
        public static void SetValue(string inputId, string @value)
        {

            _Response.WriteJScript(string.Format("window.parent.document.getElementById('{0}').value='{1}';", inputId, @value));
        }
        /// <summary>
        /// 设置父窗口容器的内容
        /// </summary>
        /// <param name="containerId"></param>
        /// <param name="html"></param>
        public static void SetHtml(string containerId, string @html)
        {
            _Response.WriteJScript(string.Format("window.parent.document.getElementById('{0}').innerHTML=\"{1}\";", containerId, @html));
        }

    }
}
